<?php
require_once 'common.inc';
session_start ();
if (! isset ( $_POST ['id'] ) or ! isset ( $_POST ['password'] ))
	exit ();
$sql = "SELECT * FROM user WHERE id='" . $_POST ['id'] . "' AND password='" . $_POST ['password'] . "'";
$result = execSQL ( $sql );
if ($row = mysql_fetch_array ( $result )) {
	$_SESSION ['id'] = $row ['id'];
	$_SESSION ['name'] = $row ['name'];
	$_SESSION ['gender'] = $row ['gender'];
	$_SESSION ['department'] = $row ['department'];
	$_SESSION ['aboutme'] = $row ['aboutme'];
	echo ("{\"success\":true}");
} else
	echo ("{\"success\":false}");
?>